package com.cmbyc.source

import org.apache.flink.core.fs.FileSystem
import org.apache.flink.streaming.api.scala.{StreamExecutionEnvironment, createTypeInformation}





/**
 *
 * @program: com.cmbyc.source
 * @author: YCLW058
 * @create: 2021-05-18 14:23
 * @decsription:
 *
 * */


//定义样例类 学生
//case class Student( id: Int,name:String,age:Int )

object File {
//  def main(args: Array[String]): Unit = {
//    //1 enc 准备环境
//    val env=StreamExecutionEnvironment.getExecutionEnvironment
//    env.setParallelism(1)
//    //2 source 加载数据
//    val datalist=List(
//      Student(1,"jock",19),
//      Student(2,"tom",29),
//      Student(3,"xyou",18),
//      Student(4,"haiq",16),
//    )
//    val ds = env.fromCollection(datalist)
//    val ds2 = env.readTextFile("D:\\tool\\server\\IDEA\\code\\Java\\Flink\\Flink_scala\\data\\input\\hello.txt")
//    //3 teasnformation 数据处理
//    //4 sink 数据输出
//    //ds.print()
//    //ds.writeAsText("D:\\tool\\server\\IDEA\\code\\Java\\Flink\\Flink_scala\\data\\output\\test",FileSystem.WriteMode.OVERWRITE).setParallelism(1)
//    ds2.print()
//
//    //5 execute 执行
//    env.execute()
//  }

}
